package array.maxArea;
/**
 * @Date 2020/04/12
 * @author 王光浩
 * @Thinking 使用双指针方法
 */
public class MyMethodTwo {
	public int maxArea(int[] height) {
		int left=0;
		int right=height.length-1;
		int ret=Integer.MIN_VALUE;
		while(left<right) {
			ret=height[left]<height[right]?
					Math.max(ret, (right-left)*height[left++]):Math.max(ret, (right-left)*height[right]);
		}
		return ret;
	}
}
